import { IModuleManager, IShareManager, IAdManager, IMemberManager, IAuthManager } from '../IManager';
import { TYObject } from '../../TYLibrary/System/System';
import { Wx_Application } from '../EntityBase';
import { ShareManager } from './ShareManager';
import { AdManager } from './AdManager';
import { AuthManager } from './AuthManager';
import { MemberManager } from './MemberManager';

export class ModuleManager extends TYObject implements IModuleManager {
    protected m_App: Wx_Application = null;

    public AuthManager: IAuthManager;
    public MemberManager: IMemberManager;
    public AdManager: IAdManager;
    public ShareManager: IShareManager;

    constructor(App: Wx_Application) {
        super();
        this.m_App = App;

        this.ShareManager = new ShareManager(this.m_App);
        this.AdManager = new AdManager(this.m_App);
        this.AuthManager = new AuthManager(this.m_App);
        this.MemberManager = new MemberManager(this.m_App);
    }

    public async Init() {
        await this.ShareManager.Init();
        await this.AdManager.Init();
        await this.AuthManager.Init();
    }
}